import React from 'react'
import {useSelector,useDispatch} from "react-redux" // 将仓库中的数据拿过来，相当于mapStateToProps
function App() {
   let store = useSelector((state)=>{
        return {
            ...state
        }
   })
   let dispatch = useDispatch()
   console.log(store);
   let fn = ()=>{
        dispatch({
            type:"bbb",
            payload:"wangwu"

        })
   }
  return (
    <div>
        {
            store.name
        }
        <button onClick={fn}>点击我修改仓库里的数据</button>
    </div>
  )
}

export default App